package game.leon.engine.net.example.server;

import game.leon.engine.net.GateServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * User: bianpeng
 * Date: 11-12-27
 */
@Component
public class Server {
    @Value("#{app.game_port}")
    private int port;
    @Value("#{app.name}")
    private String name;
    private GateServer leonServer = new GateServer();
    @Autowired
    private ServerMessageReceiver serverMessageReceiver;
    public void start() throws IOException {
        leonServer.start(port, serverMessageReceiver);
    }
}
